# coding:utf-8

import requests

class HtmlDownloader(object):

    def download(self, url):
        if url is None:
            return None

        user_agent = 'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Ubuntu Chromium/62.0.3202.94 Chrome/62.0.3202.94 Safari/537.36'
        headers = {'User-Agent':user_agent}
        r = requests.get(url, headers=headers)

        if r.status_code == 200:
            r.encoding = 'utf-8'
            return r.text

        return None


    